<template>
  <div>
    <h1>mutations</h1>
    <h2>{{ this.$store.state.myData }}</h2>
    <button @click="changeMyData">
      changeMyData
    </button>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  mounted() {
    console.log(this)
  },
  methods: {
    ...mapMutations([
      'setMyData'
    ]),
    changeMyData() {
      this.setMyData('new data')
    // this.$store.commit('setMyData', 'new Data')
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
